@extends('layouts.admin')
@section('title') @parent 圈子列表 @stop
@section('page_title')@parent
圈子列表
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('circle-index')  }}
@show
@section('content')
<div class="box">
		<div class="box-header">
			<h3 class="box-title">圈子</h3>
		</div>
		<div class="box-body table-responsive">	
				@include('widgets.notification')
				<div class="pad">
					
				</div>
				<div role="grid" class="dataTables_wrapper form-inline" id="example1_wrapper">
					{{ Form::open(array('method' => 'GET', 'class'=>'form-inline frm')) }}
					圈子名称 <input type="text" name="group_name" value="{{ $search_name }}" placeholder="请输入圈子名称">
					<button class="btn btn-sm btn-default" type="submit">查询</button>
					{{ Form::close() }}
				</div>
				<table class="table table-bordered table-hover dataTable">
					<thead>
					<tr>
						<th>编号</th>
						<th>圈子名称</th>
						<th>群主</th>
						<th>是否推荐</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
							@if(count($list)>0)
							@foreach ($list as $circle)
							<tr>
								<td>{{ $circle->id }}</td>
								<td>{{ $circle->group_name }}</td>
								<td>
									@foreach($circle->admins() as $admin)
									{{ $admin->realname() }}&nbsp;
									@endforeach
								</td>
								<td>@if ($circle->is_recommended) 是 @else 否 @endif</td>
								<td>
									<a href="{{ route('admin.circle.members', $circle->id) }}">成员</a>&nbsp;&nbsp;
									<a href="{{ route('admin.circle.posts',  $circle->id) }}">帖子</a>&nbsp;&nbsp;
									<a href="{{ route('admin.circle.edit', $circle->id) }}" title="修改">&nbsp;&nbsp;<span class="glyphicon glyphicon-edit"></span></a>&nbsp;&nbsp; 
									<a href="{{ route('admin.circle.remove',$circle->id) }}" onclick="return confirm('确定要删除该圈子么？'')" class="btn-del">&nbsp;&nbsp;<span class="glyphicon glyphicon-remove danger"></span></a>
								</td>
							</tr>
							@endforeach
							@endif
					</tbody>
				</table>
		</div>
		<div class="box-footer clearfix">
			{{ $list->appends(Input::except('page'))->links() }}
		</div>
</div>
@stop
@section('end') @parent
@stop